#已设置忽略  PEP8.E265


import cv2
clicked = False


def onmouse(event, x, y, flags, param):
    global clicked
    if event == cv2.EVENT_LBUTTONUP:
        clicked = True


cameraCapture = cv2.VideoCapture(0)


cv2.namedWindow('Mark')
cv2.setMouseCallback('Mark', onmouse)
print('showing camera feed. click window or press an key to stop')
success, frame=cameraCapture.read()
while success and cv2.waitKey(1) == -1 and not clicked:
    cv2.imshow('Mark', frame)
    success, frame = cameraCapture.read()
cv2.destroyWindow('Mark')
cameraCapture.release()

